package com.springcloud.netflix.eureka.eurekafeignclient.web;

import com.springcloud.netflix.eureka.eurekafeignclient.service.FeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 纪翔宇
 */
@RestController
public class FeignController {

    @Autowired
    private FeignService service;

    @GetMapping("info")
    public String info(){
        return "this is fegin client!";
    }

    @GetMapping("hello")
    public String hello(@RequestParam(value = "name",required = false) String name){
        return service.sayHelloFromRibbon(name);
    }

    @GetMapping("ribbonhello")
    public String ribbonHello(@RequestParam(value = "name",required = false) String name){
        return "hello,"+name+" this is feign spring cloud";
    }

}
